﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/MasterPage.master" AutoEventWireup="true" CodeFile="Me.aspx.cs" Inherits="admin_Me" %>
<%@ MasterType VirtualPath="~/admin/MasterPage.master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="main" Runat="Server">
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>我的主页
            </h1>
            <ol class="breadcrumb">
                <li><a href="Me.aspx"><i class="fa fa-dashboard"></i>我的主页</a></li>
            </ol>
        </section>
        
        <!-- Main content -->
        <section class="content">

            <div class="row">
                <div class="col-md-3">

                    <!-- Profile Image -->
                    <div class="box box-primary">
                        <div class="box-body box-profile">
                            <img class="profile-user-img img-responsive img-circle" src="<%# Master.ProfileArr[4] %>" alt="User profile picture">
                            
                            <h3 class="profile-username text-center"><%# Master.ProfileArr[1] %></h3>

                            <p class="text-muted text-center"><%# Master.ProfileArr[2] %></p>
                        </div>
                        <!-- /.box-body -->
                    </div>
                    <!-- /.box -->

                    <!-- About Me Box -->
                    <div class="box box-primary">
                        <div class="box-header with-border">
                            <h3 class="box-title">About Me</h3>
                        </div>
                        <!-- /.box-header -->
                        <div class="box-body">
                            <strong><i class="fa fa-book margin-r-5"></i>教育</strong>

                            <p class="text-muted">
                                <%# Master.ProfileArr[5] %>
                            </p>

                            <hr>

                            <strong><i class="fa fa-map-marker margin-r-5"></i>地址</strong>

                            <p class="text-muted"><%# Master.ProfileArr[6] %></p>

                            <hr>

                            <strong><i class="fa fa-file-text-o margin-r-5"></i>签名</strong>

                            <p><%# Master.ProfileArr[7] %></p>
                        </div>
                        <!-- /.box-body -->
                    </div>
                    <!-- /.box -->
                </div>
                <!-- /.col -->
                <div class="col-md-9">
                    <div class="nav-tabs-custom">
                        <ul class="nav nav-tabs">
                            <li class="active"><a href="#timeline" data-toggle="tab">我的评论</a></li>
                            <li><a href="#settings" data-toggle="tab">设置个人信息</a></li>
                            <li><a href="#account" data-toggle="tab">账户设置</a></li>
                        </ul>
                        <div class="tab-content">
                            <div class="active tab-pane" id="timeline">
                                <ul class="timeline timeline-inverse">
                                    
                                    <li class="time-label">
                                        <span class="bg-purple">我的历史评论
                                        </span>
                                    </li>
                                    
                                    <asp:ListView ID="ListView1" runat="server">
                                        <ItemTemplate>
                                            <li>
                                                <i class="fa fa-comment bg-blue"></i>

                                                <div class="timeline-item">
                                                    <span class="time"><i class="fa fa-clock-o"></i><%# Eval("created_at") %></span>

                                                    <h3 class="timeline-header">评论<a href="/front/show.aspx?id=<%# Eval("news_id") %>"><%# Eval("title") %></a></h3>

                                                    <div class="timeline-body">
                                                        <%# Eval("comments") %>
                                                    </div>
                                                </div>
                                            </li>
                                        </ItemTemplate>
                                    </asp:ListView>

                                    <li>
                                        <i class="fa fa-clock-o bg-gray"></i>
                                    </li>
                                </ul>
                            </div>
                            <!-- /.tab-pane -->

                            <div class="tab-pane" id="settings">
                                <div class="form-horizontal">
                                    <div class="form-group">
                                        <label for="photo" class="col-sm-2 control-label">头像上传</label>

                                        <div class="col-sm-10">
                                            <asp:Image ID="Image1" runat="server" ImageUrl=<%# Master.ProfileArr[4] %> CssClass="user-image" Width="72" style="margin-bottom:15px"/>
                                            <asp:FileUpload ID="FileUpload1" runat="server" CssClass="form-control" />
                                            <asp:Label ID="Label1" runat="server" Text="上传头像格式为jpg, png 大小不超过1M"></asp:Label>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="inputName" class="col-sm-2 control-label">用户名</label>

                                        <div class="col-sm-10">
                                            <asp:TextBox ID="TextBox1" runat="server" CssClass="form-control" placeholder="用户名" Text=<%# Master.ProfileArr[1] %>></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="用户名不可为空" ControlToValidate="TextBox1" ForeColor="#a94442"></asp:RequiredFieldValidator>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="inputEmail" class="col-sm-2 control-label">教育</label>

                                        <div class="col-sm-10">
                                            <asp:TextBox ID="TextBox2" runat="server" CssClass="form-control" placeholder="教育" Text=<%# Master.ProfileArr[5] %>></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="教育不可为空" ControlToValidate="TextBox2" ForeColor="#a94442"></asp:RequiredFieldValidator>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="inputName" class="col-sm-2 control-label">地址</label>

                                        <div class="col-sm-10">
                                            <asp:TextBox ID="TextBox3" runat="server" CssClass="form-control" placeholder="地址" Text=<%# Master.ProfileArr[6] %>></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="地址不可为空" ControlToValidate="TextBox3" ForeColor="#a94442"></asp:RequiredFieldValidator>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="inputExperience" class="col-sm-2 control-label">签名</label>

                                        <div class="col-sm-10">
                                            <asp:TextBox ID="TextBox4" runat="server" CssClass="form-control" placeholder="个人签名" TextMode="MultiLine" Rows="3" Text=<%# Master.ProfileArr[7] %>></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="个人签名不可为空" ControlToValidate="TextBox4" ForeColor="#a94442"></asp:RequiredFieldValidator>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-offset-2 col-sm-10">
                                            <asp:Button ID="Button1" runat="server" Text="保存" OnClick="UpdateProfile" CssClass="btn btn-primary" CausesValidation="false" />
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!-- /.tab-pane -->
                            <div class="tab-pane" id="account">
                                <div class="form-horizontal">
                                    <div class="form-group">
                                        <h4 class="col-sm-2 control-label">修改密码</h4>
                                    </div>
                                    
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">注册邮箱</label>

                                        <div class="col-sm-10">
                                            <p class="form-control-static"><%# Master.ProfileArr[2] %></p>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="old" class="col-sm-2 control-label">旧密码</label>

                                        <div class="col-sm-10">
                                            <asp:TextBox ID="TextBox5" runat="server" placeholder="旧密码" CssClass="form-control" TextMode="Password"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="请输入当前密码" ControlToValidate="TextBox5" ForeColor="#a94442"></asp:RequiredFieldValidator>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="new" class="col-sm-2 control-label">新密码</label>

                                        <div class="col-sm-10">
                                            <asp:TextBox ID="TextBox6" runat="server" placeholder="新密码" CssClass="form-control" TextMode="Password"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="请输入新密码" ControlToValidate="TextBox6" ForeColor="#a94442"></asp:RequiredFieldValidator>

                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="again" class="col-sm-2 control-label">再输入一次</label>

                                        <div class="col-sm-10">
                                            <asp:TextBox ID="TextBox7" runat="server" placeholder="再输入一次" CssClass="form-control" TextMode="Password"></asp:TextBox>
                                            <asp:CompareValidator ID="CompareValidator1" runat="server" ErrorMessage="请再输入一次新密码" ControlToCompare="TextBox6" ControlToValidate="TextBox7" ForeColor="#a94442"></asp:CompareValidator>
                                            <asp:Label ID="Label2" runat="server" CssClass="text-danger"></asp:Label>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-offset-2 col-sm-10">
                                            <asp:Button ID="Button2" runat="server" Text="修改" CssClass="btn btn-primary" OnClick="UpdatePW" />
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!-- /.tab-pane -->
                        </div>
                        <!-- /.tab-content -->
                    </div>
                    <!-- /.nav-tabs-custom -->
                </div>
                <!-- /.col -->
            </div>
            <!-- /.row -->

        </section>
        <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="script" Runat="Server">
</asp:Content>

